<?php

// TODO: Юзать неймспейсы   
require_once($CFG->dirroot . '/lib/datalib.php');

class block_myguestbook extends block_base {

    function init() {
        $this->title = get_string('pluginname', 'block_myguestbook');
    }

    function specialization() {
        
    }

    function applicable_formats() {
        return array('all' => true);
    }

    function instance_allow_multiple() {
        return false;
    }

    function get_content() {
        global $CFG, $PAGE, $COURSE;
        if ($this->content !== NULL) {
            return $this->content;
        }
        if (empty($this->instance)) {
            return $this->content;
        }

        $url = new moodle_url('/blocks/myguestbook/myguestbook_form.php');

        $this->content = new stdClass();
        $this->content->text = '<a href="/blocks/myguestbook/view.php">Go to guest book!</a>';
        $this->content->footer = '';

        return $this->content;
    }
}